]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Make st_scroll_view_update_fade_effect() public
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 4 Sep 2013 11:28:31 +0000 (13:28 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 4 Sep 2013 21:52:18 +0000 (23:52 +0200)
Using fixed fade offsets is not always appropriate, this will allow
to set them from code instead.

https://bugzilla.gnome.org/show_bug.cgi?id=707409

src/st/st-scroll-view.c
src/st/st-scroll-view.h

index f59ae93351f855d8401f3a4b8a074fb33b4f6cb5..eb35928f2455a77b7ff9f4fcbec492900b861a39 100644 (file)
@@ -160,19 +160,19 @@ st_scroll_view_get_property (GObject    *object,
 
 /**
  * st_scroll_view_update_fade_effect:
- * @self: a #StScrollView
+ * @scroll: a #StScrollView
  * @vfade_offset: The length of the veritcal fade effect, in pixels.
  * @hfade_offset: The length of the horizontal fade effect, in pixels.
  *
  * Sets the height of the fade area area in pixels. A value of 0
  * disables the effect.
  */
-static void
-st_scroll_view_update_fade_effect (StScrollView *self,
+void
+st_scroll_view_update_fade_effect (StScrollView *scroll,
                                    float vfade_offset,
                                    float hfade_offset)
 {
-  StScrollViewPrivate *priv = ST_SCROLL_VIEW (self)->priv;
+  StScrollViewPrivate *priv = ST_SCROLL_VIEW (scroll)->priv;
 
   /* A fade amount of more than 0 enables the effect. */
   if (vfade_offset > 0. || hfade_offset > 0.)
@@ -180,7 +180,7 @@ st_scroll_view_update_fade_effect (StScrollView *self,
       if (priv->fade_effect == NULL) {
         priv->fade_effect = g_object_new (ST_TYPE_SCROLL_VIEW_FADE, NULL);
 
-        clutter_actor_add_effect_with_name (CLUTTER_ACTOR (self), "fade",
+        clutter_actor_add_effect_with_name (CLUTTER_ACTOR (scroll), "fade",
                                             CLUTTER_EFFECT (priv->fade_effect));
       }
 
@@ -194,12 +194,12 @@ st_scroll_view_update_fade_effect (StScrollView *self,
    else
     {
       if (priv->fade_effect != NULL) {
-        clutter_actor_remove_effect (CLUTTER_ACTOR (self), CLUTTER_EFFECT (priv->fade_effect));
+        clutter_actor_remove_effect (CLUTTER_ACTOR (scroll), CLUTTER_EFFECT (priv->fade_effect));
         priv->fade_effect = NULL;
       }
     }
 
-  clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
+  clutter_actor_queue_redraw (CLUTTER_ACTOR (scroll));
 }
 
 static void
index 517e7dc214d5ae94e0444f8c0948c276e8a6c35c..02dababd4e947c543ebe90678bcfe5ea3abb7089 100644 (file)
@@ -87,6 +87,9 @@ gboolean      st_scroll_view_get_overlay_scrollbars (StScrollView *scroll);
 void          st_scroll_view_set_policy          (StScrollView   *scroll,
                                                   GtkPolicyType   hscroll,
                                                   GtkPolicyType   vscroll);
+void          st_scroll_view_update_fade_effect  (StScrollView *scroll,
+                                                  float vfade_offset,
+                                                  float hfade_offset);
 
 G_END_DECLS